refactor(cli): route Peer Host through the assembled runtime - #1557
Merged
Conversation
limityan
force-pushed
the
yanzhn/cli-peer-runtime-cutover
branch
2 times, most recently
from
July 15, 2026 14:38
5c2306f to
ecdd90f
Compare
limityan
force-pushed
the
yanzhn/cli-peer-runtime-cutover
branch
from
July 15, 2026 14:47
ecdd90f to
7875561
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type and Areas
Type: refactor / regression hardening / tests / docs
Areas: CLI Peer Host, shared agent runtime coordination, background sub-agent delivery, existing architecture docs, Peer detach policy
Motivation and Impact
Peer Host previously assembled persistence, scheduler, event-queue, and snapshot owners beside the product runtime. That duplicated lifecycle ownership and allowed cancellation, detach, terminal delivery, and background-result handoff to diverge from the shared runtime.
No throughput improvement is claimed. The model execution hot path is unchanged. Added work is bounded hash-map/set lookup on Peer lifecycle events and per-session serialization only for background delivery, cancellation, and destructive maintenance.
Correctness Hardening
Verification
cargo +nightly test -p bitfun-cli— passed: 123 unit tests plus 16 CLI integration/contract tests.cargo +nightly test -p bitfun-cli peer_host:: -- --nocapture— passed: 50 Peer Host tests.cargo +nightly test -p bitfun-core --lib background_ -- --nocapture— passed: 25 targeted background lifecycle tests.cargo +nightly test -p bitfun-agent-runtime --test scheduler_contracts— passed: 28 scheduler contract tests.cargo +nightly check --workspace --exclude bitfun-desktop— passed; only existing dependency/WebDriver warnings were reported.node --test scripts/check-core-boundaries.test.mjs— passed.pnpm --dir src/web-ui run test:run— passed: 251 files / 1549 tests; no Web files changed after this run.pnpm run type-check:webandpnpm run lint:web— passed; lint reported 11 existing warnings and no errors.git diff --check gcwing/main...HEAD— passed.The desktop-inclusive workspace check remains unavailable because this worktree does not contain the generated
src/mobile-web/distartifact. The non-desktop workspace and all affected CLI/Core paths pass.Scope Boundary
Checklist
main.